<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #output{
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
        <input type="text" id="score">
        <input type="button" id="btn" value="评判">
        <div id="output"></div>


            <script>
                var scoreobj = document.getElementById('score');
                var btn = document.getElementById('btn');
                var output = document.getElementById('output');
                btn.onclick = function () {
                    var score = scoreobj.value;
                    var s =' ';

                    if(score==10){
                        s = '满分';
                    } else if(score >=9 && score<10){
                        s = '优秀';
                    } else if (score >=8 && score<9){
                        s = '良好';
                    } else if (score >=7 && score<8){
                         s = '一般';2
                   } else if(score >=6 && score<7){
                         s = '及格';

                    } else if(score > 10 ||score < 0 ){
                       alert('请输入0-10之间的数')
                    }else if(score != parseInt(score)){
                        alert('请输入数字')
                    }
                    else {
                         s = '不及格';
                    }






                    console.log(s);


                    output.innerHTML = s;
                }
            </script>
</body>
</html>